package org.twndmv.blimpl;

import java.util.List;

import org.twndmv.bl.PersonMgmt;
import org.twndmv.bo.Person;
import org.twndmv.dao.PersonDAO;
import org.twndmv.jpa.PersonDAOImpl;

public class PersonMgmtImpl implements PersonMgmt {

	private PersonDAO personDAO;
	
	public PersonMgmtImpl() {
		personDAO = new PersonDAOImpl();
	}
	
	public PersonMgmtImpl(PersonDAO personDAO2) {
		this.personDAO = personDAO2;
	}

	public List<Person> getPeopleByLastName(String name) {
		return personDAO.getPersonByLastName(name);
	}
	
	public List<Person> getAllPeople() {
		return personDAO.getAllDrivers();
	}

	public Person getPersonByID(long personId) {
		return personDAO.getPersonByID(personId);
	}

	@Override
	public void updatePerson(Person resultPerson) {
		personDAO.updatePerson(resultPerson);
	}
	
	@Override
	public void createPerson(Person newPeep) {
		personDAO.createPerson(newPeep);
	}

}
